package com.atguigu.tingshu.order.cleint;

import com.atguigu.tingshu.model.order.OrderInfo;
import com.atguigu.tingshu.order.service.OrderInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/***
 * order-server Feign Client API
 */
@RestController
@RequestMapping("/client/order/orderInfo")
public class OrderInfoFeignClient {
    @Autowired
    private OrderInfoService orderInfoService;

    /**
     * 查询用户下单但未付款的声音id列表
     * @param userId
     * @return
     */
    @GetMapping("/getUserTrackOrderInfo/{userId}")
    public Map<String,Object> getUserTrackOrderInfo(@PathVariable("userId")Long userId){
        return orderInfoService.getUserTrackOrderInfo(userId);
    }


    /**
     * 根据orderNo获取订单详情
     * @param orderNo
     * @return
     */
    @GetMapping("/getOrderInfo/{orderNo}")
    public OrderInfo getOrderInfo(@PathVariable("orderNo") String orderNo){
        return orderInfoService.getOrderInfo(orderNo);
    }




}
